<template>
  <q-page-scroller position="bottom-right" :offset="[18, 18]" scroll-offset="100">
    <q-btn
      round
      color="primary"
      icon="keyboard_arrow_up"
      size="md"
      @click="scrollToTop"
    />
  </q-page-scroller>
</template>

<script setup>
import { useQuasar } from 'quasar'

const $q = useQuasar()

const scrollToTop = () => {

  $q.scroll.setScrollPosition(window, 0, 500) // 500ms 平滑滚动
}
</script>
